package cn.edu.sdjzu.xg23.kcsj01_backend.mapper;

import cn.edu.sdjzu.xg23.kcsj01_backend.entity.SupportingMaterial;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface SupportingMaterialMapper {
    List<SupportingMaterial> getSupportingMaterialsByAchievementId(Long achievementId);

    boolean addSupportingMaterials(Long achievementId, List<SupportingMaterial> supportingMaterials);

    @Select("SELECT * FROM supporting_material WHERE achievement_id = #{achievementId}")
    List<SupportingMaterial> findByAchievementId(Long achievementId);

    @Delete("DELETE FROM supporting_material WHERE achievement_id = #{achievementId}")
    boolean deleteSupportingMaterials(Long achievementId);



    int deleteByIds(List<Long> ids);
}